package zxs.sino.elite.hub.enums.article;

import zxs.sino.elite.hub.enums.BaseEnum;

/**
 * 文章发表状态
 *
 * @author zhang
 */
public enum PublishStatus implements BaseEnum<Integer> {

    UNPUBLISH(0, "未发表"),
    PUBLISHED(1, "已发表");


    private final int code;
    private final String value;

    PublishStatus(int code, String value) {
        this.code = code;
        this.value = value;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getValue() {
        return value;
    }

    public static boolean isPublishOff(Integer code) {
        return BaseEnum.isType(PublishStatus.class, code, UNPUBLISH);
    }

    public static boolean isPublishOn(Integer code) {
        return BaseEnum.isType(PublishStatus.class, code, PUBLISHED);
    }
}